<!--<?php
if($job == 'slide'){print <<<EOT
-->
<style type="text/CSS">
<!--
input { 
    border-right: #7b9ebd 1px solid;
 padding-right: 2px;
 border-top: #7b9ebd 1px solid;
 padding-left: 2px;
 font-size: 12px;
 filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#cecfde);
 border-left: #7b9ebd 1px solid;
 cursor: hand;
 color: black;
 padding-top: 2px;
 border-bottom: #7b9ebd 1px solid;
}
.img {
 filter:alpha(opacity=1,enabled=1)  blendtrans(duration=1);
    border:1px solid #CCCCCC;
}
-->
</style>
<script language="JavaScript">
var l=0;
var sum=0;
var chk_l;
var _c = 0;
var _i = 0;
var _v = 0;
var _l = 0;
var _fi = 0;
var _sf = 3000;
var _HTML = null;
var _image = null;
var _mycars= new Array();
var _w = new Array();
var _h = new Array();
var imgs = new Array();
var limg=new Array();
var imgtext = "$imgs";
var imgurls = imgtext.split("|");
var imgpath = "$imgpath"+'/loading.jpg';

/* 渐隐渐现 */
function  transImg(enable){
 GE("showimg").filters.blendtrans.Apply();
 GE("showimg").filters[0].enabled=enable;
 GE("showimg").filters.blendtrans.Play();
}

/* 加载图片 */

function chk(){
  chk_l--;
  GE("rotatorPlayer").innerHTML='<img src='+limg[0].src+'><br><br>' + '照片已加载：' + parseInt(((sum-chk_l)*100/sum)).toString() + '%'
  if (chk_l==0){
   adRotator.play();
   GE('stops').disabled='';
   GE('next').disabled='';
  }
}

if (document.images){
  limg[0]=new Image();
  limg[0].src=imgpath;
  for(var i=0;i<imgurls.length;i++)
  {
    imgs[i]=new Image();
 	imgs[i].src=imgurls[i];
  }
}


function adRotator() {}

adRotator.prototype = {
	
	add : function(p,w,h){
		_mycars[_c] = p;
   		_w[_c] = w;
   		_h[_c] = h;
   		_c = _c + 1;
	},
	
	/* 播放设置 */
	loads : function(){
	   if (_i < _mycars.length && _l < 1)
	   {
	     _HTML = '<img id="showimg" src="' + _mycars[_i] + '" width="' + _w[_i] + '" height="' + _h[_i] + '" class="img">'
	     if (_v < 1)
	     {
	        GE('image').value = _HTML + ',' + _i;
	        GE('rotatorPlayer').innerHTML = _HTML;
	  		transImg(0);
	        _i = _i + 1;
	  		GE('backs').disabled='';
	  		transImg(1);
	  		transImg(0);
	        window.setTimeout("adRotator.loads("+_i+")",_sf);
	     }
	   }
	   else
	   {
	     _HTML = '<img id="showimg" src="' + _mycars[_i] + '" width="' + _w[_i] + '" height="' + _h[_i] + '" class="img">'
	  	GE('image').value = _HTML + ',' + _i;
	    GE('rotatorPlayer').innerHTML = _HTML;
	    transImg(0);
	    transImg(1);
	    transImg(0);
	   }
	   if (_i+1 > _mycars.length)
	   {
	      GE('stops').disabled='True';
	   	  GE('play').disabled='';
	      GE('backs').disabled='';
	      GE('next').disabled='True';
	      _i = 0;
	      _v = 1;
	   }
	},
	
	/* 播放 */
	play : function(){
	   _v = 0;
	   _l = 0;
	   adRotator.loads();
	},
	
	/* 下一张 */
	next : function(){
	   _l = 1;
	   if(_i+1 < _mycars.length)
	   {
	      _i = _i + 1;
	   GE('play').disabled='';
	   GE('stops').disabled='True';
	   GE('backs').disabled='';
	   adRotator.loads();
	   }
	   else
	   {
	      GE('next').disabled='True';
	   }
	},
	
	/* 上一张 */
	backs : function(){
	   _l = 1;
	   if(_i-1 < 0)
	   {
	      GE('backs').disabled='True';
	   }
	   else
	   {
	      _i = _i - 1;
	   GE('play').disabled='';
	   GE('stops').disabled='True';
	   GE('next').disabled='';
	   adRotator.loads();
	   }
	},
	
	/* 间隔时间 */
	set : function(){
	   var _sfc = GE('second').value;
	   if (isInteger(_sfc))
	   {
	     _sf = _sfc * 1000;
	   }
	   else
	   {
	     alert('提示：只能输入数字！');
	     GE('second').value=1;
	     GE('second').select();
	   }
	},
	
	/* 字符检测 */
	isInteger : function(str){  
	  var regu = /^[-]{0,1}[0-9]{1,}$/;
	  return regu.test(str);
	},
	
	/* 暂停 */
	stops : function(){
	   _v = 1;
	}
}
var adRotator = new adRotator();

/* 添加图片 */
for (var i=0;i<imgs.length;i++)
{
   adRotator.add(imgs[i].src,400,300);
}

</script>


<table width="420" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">
<div id="rotatorPlayer" style="text-align:center"><img src="$imgpath/loading.jpg"><br><br>照片已加载：0%</div>
<br><br>
<input type="button" name="play" value="开始播放" onClick="adRotator.play();this.disabled='true';GE

('stops').disabled=''" disabled="True"/>
<input type="button" name="stops" value="暂停" onClick="adRotator.stops();this.disabled='true';GE

('play').disabled=''" disabled="True"/>
<input type="button" name="backs" value="上一张" onClick="adRotator.backs();" disabled="True"/>
<input type="button" name="next" value="下一张" onClick="adRotator.next();" disabled="True"/>&nbsp;&nbsp;&nbsp;
<input type="text" id="second" value="3" size="3" maxlength="2">
秒
<input type="button" value="设置时间" onClick="adRotator.set()" />
<br><br>
<input name="image" id="image" type="text" size="65"/>
</td>
  </tr>
</table>
<script language="JavaScript">
chk_l=sum=l=imgs.length;
for (var i=0;i<l;i++){
  imgs[1].onload;
  imgs[i].onerror;
  chk_l--;
  GE("rotatorPlayer").innerHTML='<img src='+limg[0].src+'><br><br>' + '照片已加载：' + parseInt(((sum-chk_l)*100/sum)).toString() + '%';
  if (chk_l==0){
   adRotator.play();
   GE('stops').disabled='';
   GE('next').disabled='';
  }
}
</script>
<!--
EOT;
}else{print<<<EOT
-->
<script language="JavaScript" src="js/photo.js"></script>
  <!--begin main-->
  <div id="main" class="right">
	<div class="box">
	  <h2>$left_name[newphotos]</h2>
	  <!--begin-->
<!--
EOT;
if($albumdb[$aid]['ifhide'] == '3' && $allow_read == '0'){print<<<EOT
-->
	<div class="text">
		<table class="blog-content">
			<tr colspan='2'><td>需输入密码后才能访问</td></tr>
			<tr><td>密码： <input type="password" name="album_password" id="album_password"></td></tr>
			<tr colspan='2'><td><input type="button" name="button" value="提交" onclick="check_apassword($uid,$aid)"></td></tr>
		</table>
	</div>
<!--
EOT;
}elseif($allow_read == '1'){print<<<EOT
-->
	  <div class="text">
		<table class="blog-content">
		  <tr>
			<td>
			  <div class="listPic">
<!--
EOT;
foreach($photos as $newpic){print <<<EOT
-->
				<dl id=photo_{$newpic[pid]}>
				<dd><a href="blog.php?do=showone&uid=$uid&type=photo&aid=$aid&pid=$newpic[pid]"><img src="$newpic[attachurl]"/></a></dd>
				<dt>$newpic[name]</dt>
				<dt>浏览:$newpic[phits]　回复:$newpic[preplies]</dt>
				
				</dl>
<!--
EOT;
}print <<<EOT
-->
			  </div>
			  <div class="c"></div>
			  $pages
			</td>
		  </tr>
		</table>
	  </div>
<!--
EOT;
}
print<<<EOT
-->
	  <!--end-->
	</div>
  </div>
  <!--end main-->
<!--
EOT;
}
?>